/**
 * OPay Inc.
 * Copyright (c) 2016-2022 All Rights Reserved.
 */
package cc.dd.marketing.system.exception.base;

import lombok.Data;

/**
 * @author sufeng.dong
 * @version $Id: BaseException.java, v 0.1 2022-05-24 2:09 PM sufeng.dong Exp $$
 */
@Data
public class BaseException extends RuntimeException {

    private String code;
    private String message;
    private IResponseEnum responseEnum;

    public BaseException(IResponseEnum responseEnum, String message) {
        super(message);
        this.code = responseEnum.getCode();
        this.message = message;
    }

    public BaseException(IResponseEnum responseEnum) {
        super(responseEnum.getMessage());
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMessage();
    }

    public BaseException(String code,String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BaseException(IResponseEnum responseEnum, String message, Throwable cause) {
        super(cause);
        this.code = responseEnum.getCode();
        this.message = message;
    }

}
